﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IMAPI2.Interop;
using System.Runtime.InteropServices;
using System.Threading;

namespace SoundServant
{
    public class CD
    {
        public readonly StoredDisc Disc;
        public string ForWho;
        Burner max;

        public int Num
        {
            get
            {
                return max.Queue.IndexOf(this) + 1;
            }
        }

        public CD(StoredDisc _disc, string _forWho, Burner _max)
        {
            Disc = _disc;
            max = _max;
            ForWho = _forWho;
            Library.BookAnotherCopyOut(Disc.Recording);
            Disc.Recording.Locks++;
        }

        public void Done()
        {
            Disc.Recording.Locks--;
            Library.ReturnRecording(Disc.Recording);
        }
    }
}
